home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / print / etsr301.zip / LPTX.DOC < prev    next >
Text File  |  1987-03-31  |  9KB  |  212 lines

  1. LPTx : Line Printer Output Capture Routine
  2.  
  3. ------------------------------------------------------------------------
  4.  
  5.  Version 6.00
  6.  
  7.  (C)    Copyright 1987 by Mark DiVecchio, All Rights Reserved
  8.  
  9.  
  10.  
  11. This program is released for use in non-commercial environments. I ask
  12. commercial users to register the program with a $25 copyright fee for each
  13. site (any number of users and computers) at which the program is used.
  14.  
  15. DISCLAMER : This program tries to perform a function which is not supported
  16. by DOS. It will work sometime and will not work other times. That kind of
  17. explains why you don't see this type of program on the market. I have
  18. tested it under DOS 2.x and 3.x. In particular, under 3.x, I used dBase-II.
  19. I have not tested it with dBase-III or dBase-III+.
  20.  
  21.  Mark C. DiVecchio
  22.  10435 Mountain Glen Terrace
  23.  San Diego, CA 92131
  24.  619-566-6810
  25. ------------------------------------------------------------------------
  26.  
  27.     First - some thanks...  I would like to thank all of the users who
  28. have called me about the earlier versions of LPTx which has been floating
  29. around for about a year. The program has met with mixed success. There
  30. seems to be no pattern as to when the program works and when it doesn't. I
  31. am still searching for the solution to this very difficult problem. This
  32. version and versions 4.x and 5.x which preceeded it are attempts to perform
  33. the same function with a different algorithm. Version 3.00, 4.00, 5.00 and
  34. 6.00 are not replacements or upgrades of each other but just alternative
  35. implementations.
  36.  
  37. ------------------------------------------------------------------------
  38.  
  39.     Have you ever wanted to get some data from your screen into a
  40. program? Have you ever wanted to grab onto some printer data and put it
  41. into a disk file but the program you are using does not have that as a
  42. option? Well here is the answer to your problem. This program will grab
  43. onto anything sent out of a line printer port as long as the program uses
  44. the standard BIOS INT 17h call. This version works with Shift-PrtSc or
  45. Ctrl-PrtSc but does not work with the DOS TYPE command.
  46.  
  47.     This program intercepts the BIOS interrupt 17h, the line printer
  48. interrupt. It will redirect the output of LPT1, LPT2, or LPT3 to a disk
  49. file. All three redirections may be active at the same time.
  50.  
  51.     This version of LPTx counts on the PC having some "free time" in
  52. order to write the data to disk. The program gathers data into a large
  53. buffer and during timer interrupts and keyboard idle periods, it writes it
  54. to disk. DOS must not be in its critical section for the write to take
  55. place. LPTx does not work with the DOS TYPE apparently because the critical
  56. section flag is always set when the timer interrupts occur. It should work
  57. with most user programs since the critical section flag is not set in user
  58. programs and therefore will not be set when timer interrupts occur.
  59.  
  60.     Look at the Assembly Language Source which you should have received
  61. with this documentation file. If you would like the other versions of LPTx,
  62. I will be happy to send them to you. Just send me a formatted 360K DSDD
  63. floppy (no DOS on diskette) along with a post-paid, self-addressed floppy
  64. mailer. I will send you all current versions that are active. If you
  65. received this disk directly from me, all of the different versions are
  66. already on the diskette.
  67.  
  68.     LPTx requires DOS 2.0 or later. It has been tested on version 3.1
  69. of DOS as well.
  70.  
  71. Calling sequence:
  72. lptx [?] [-x] [-l] [-i] {-1,-2,-3} {-c -o <d:[pathname]filename>}
  73.  
  74. where -1 means redirect LPT1, -2 means redirect LPT2, -3 means redirect
  75.      LPT3
  76.      This option must appear first
  77.  
  78.       -o means start the redirection to file specified. If redirection
  79.          is already in progress for the selected line printer,
  80.      the old file will be closed first.
  81.      (If you do not specify -o but you do specify a line printer,
  82.      LPTx will use either the last file name that you gave when
  83.      you loaded LPTx or will use the file named LPTXy.LST which it
  84.      will create in the root directory on the default drive - where
  85.      y is 1, 2, or 3.)
  86.  
  87.      It is not necessary that you specify the complete path name
  88.      for the file. LPTx will create the file in the default 
  89.      directory if you don't specify a directory. LPTx will always
  90.      be able to find the file because it saves the complete path.
  91.  
  92.     -c means close the file and send all further output directly to the
  93.      line printer.
  94.  
  95.      If neither the -o or the -c option is specified, LPTx just displays
  96.      the program status.
  97.  
  98.  
  99.     -? displays a short help screen.
  100.  
  101.     -x tells LPTx to ignore the DOS Critical Section Flag. Use this
  102.      option only with great care. LPTx may do unusual things if the
  103.      flag is ignored.
  104.  
  105.     -l tells LPTx to strip linefeed characters from the data as it is
  106.      being redirected.
  107.  
  108.     -i removes LPTx from the interrupt chain. This effectively inactivates
  109.      the program. The memory which it occupies is not freed.
  110.     
  111. note: -1, -2, and -3 are mutually exclusive
  112.       -o and -c are mutually exclusive
  113.  
  114. examples:
  115.  
  116. lptx                Displays the program status
  117.  
  118. lptx ?                Displays a HELP screen
  119.  
  120. lptx -1                redirects LPT1 output to file named
  121.                 LPTX1.LST in the root directory
  122.                 on the default drive or the last
  123.                 named file.
  124.  
  125. lptx -o a:\able.xxx        redirects LPT1 output to file named
  126.     or            a:\able.xxx. Any open redirection
  127. lptx a:\able.xxx        disk file for LPT1 is closed.
  128.  
  129. lptx -2 b:xx.lst        redirects LPT2 output to file named
  130.                 XX.LST in the default directory
  131.                 on drive B:. Any open redirection
  132.                 disk file for LPT2 is closed.
  133.  
  134. lptx -3 d:\ab\cd\file.lst    redirects LPT3 output to the file named
  135.                 file.lst in the directory ab\cd on drive
  136.                 d:.
  137.  
  138. lptx -c                closes any disk files open for LPT1 and sends
  139.     or            the output back to the line printer
  140. lptx -1 -c            If no redirection is taking place to LPT1,
  141.                 this is    a NOP. LPT2 and LPT3 are not
  142.                 affected.
  143.  
  144. lptx -2 -c            closes any disk file open for LPT2 and
  145.                 sends the output back to line printer.
  146.                 if no redirection is taking place to LPT2,
  147.                 this is a NOP. LPT1 and LPT3 are not
  148.                 affected.
  149.  
  150.     By redirecting LPT2 or LPT3 to a disk file, you can in effect have
  151. 2 or 3 printers on your system. LPT1 can be your physical printer and you
  152. can have LPT2 output going to disk. When you redirect LPT2 or LPT3, LPT1
  153. works normally.
  154.  
  155.     If you are redirecting to a diskette file, do not remove the
  156. diskette once the redirection starts. I recommend redirecting to a hard
  157. disk or a RAM disk.
  158.  
  159.     If LPTx encounters any kind of error during the redirection, it
  160. terminates operation and sends output back to the line printer. It does not
  161. display anything but beeps the speaker. Four beeps indicates a DOS disk
  162. access error. Two beeps indicates an internal buffer overflow error. This
  163. prevents your currently running program from possibly getting destroyed. An
  164. error with LPT1 redirection does not shut down LPT2 or LPT3 redirection.
  165.  
  166.     LPTx captures the int 17h interrupt vector. Problems may occur with
  167. print spoolers which also take over the int 17h  vector. You can be sure
  168. that LPTx works correctly by running LPTx before you run your print
  169. spooler. LPTx will be transparent to the print spooler but your print
  170. spooler may not be transparent to LPTx. LPTx works fine with IBM's PRINT
  171. command.
  172.  
  173.     LPTx also captures the int 24h critical error interrupt vector.
  174. This is done only for the period that LPTx is using the disk. This prevents
  175. the generation of funny error messages in the middle of other programs that
  176. you may be running. (LPTx just beeps 4 times and clears itself out of way
  177. if a disk error occurs).
  178.  
  179.     This version of LPTx can redirect all three printers to three
  180. different files with all 3 active at the same time.
  181.  
  182.     LPTx worked correctly when I tested it with:
  183.  
  184.     1. dBaseII,
  185.  
  186.     2. the ARC utility with the "p" option and output redirected to prn,
  187.  
  188.     3. shift PrtSc,
  189.  
  190.     4. DOS PRINT utility,
  191.  
  192.     5. Lotus 123,
  193.  
  194.     6. dir > prn,
  195.  
  196.     LPTx did not work with:
  197.  
  198.     1. The DOS TYPE command,
  199.  
  200.     2.
  201.  
  202.     Version 6.00 of LPTx uses about 20K of memory for the resident data
  203. buffers and interrupt handler.